package com.muyu.system.danmo.service;

import com.muyu.system.danmo.domain.PayOrder;
import com.muyu.system.danmo.domain.RefundOrder;
import com.muyu.system.danmo.dto.PayServiceDTO;
import com.muyu.system.danmo.dto.PaymentCallBackResult;
import com.muyu.system.danmo.dto.RefundServiceDTO;
import com.muyu.common.core.enums.PayChannel;
import com.muyu.system.danmo.vo.PayResultVO;
import com.muyu.system.danmo.vo.RefundResultServiceVO;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Administrator
 */
public interface PayChannelService {

    /**
     * 调用三方支付
     * @param payServiceDTO
     * @param payOrder
     * @return
     */
    PayResultVO pay(PayServiceDTO payServiceDTO, PayOrder payOrder);


    /**
     * 处理回调的信息
     * @param request
     */
    ResponseEntity.BodyBuilder payNotify(HttpServletRequest request, PayChannel payChannel, String mchCode);

    /**
     * 退款回调信息
     * @param request
     * @param payChannel
     * @param mchCode
     * @return
     */
    ResponseEntity.BodyBuilder refundPayNotify(HttpServletRequest request, PayChannel payChannel, String mchCode);


    /**
     * 查询订单信息
     * @return
     */
    PaymentCallBackResult queryOrder(String mchCode, String orderNo);


    /**
     * 退款操作
     * @param refundDTO
     * @return
     */
    RefundResultServiceVO refund(RefundServiceDTO refundDTO, RefundOrder refundOrder);


    /**
     * 退款查询
     * @param refundOrder
     * @return
     */
    RefundResultServiceVO refundQueryOrder(RefundOrder refundOrder);


    /**
     * 关闭订单
     * @param payOrder
     */
    void close(PayOrder payOrder);





}
